import re
s="""
max_iterations		250000
NP					200
F					2.5
CR					1.52
test_function		g02Rastrigin
precision_digits	6
sample_step			1e-19
"""

def s2d(s):
    d={}
    for i in s.strip().split('\n'):
        t=i.strip().split()
        if len(t)==2:
            d[t[0].strip()]=t[1].strip()
    return d


def change_param(cfile,ofile,d):
    f=open(ofile,'w')
    for i in open(cfile).readlines():
        t=i.strip().split()
        if len(t)>=3 and t[0].strip().lower()=="#define" and t[1].strip() in d.keys():
                t[2]=d[t[1].strip()]
                f.write("%s\n" % " ".join(t))
        else:
            f.write(i)